package com.hgk.common.activity;

import android.app.Activity;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.widget.Button;
import android.widget.TextView;

import width.hgk.wanwan.R;

/**
 * Created by lenovo on 2016/9/22.
 */
public class MyBaseActivity extends Activity {
    private Button btn_left,btn_right;
    private TextView tv_title;

    public MyBaseActivity() {

    }
    @Override
    public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
        super.onCreate(savedInstanceState, persistentState);
        setContentView(R.layout.wherefrag_header);
        intiView();
    }

    private void intiView() {
        btn_left = (Button) findViewById(R.id.btn_left_header);
        btn_right = (Button) findViewById(R.id.btn_right_header);
        tv_title = (TextView) findViewById(R.id.tv_wherefrag_title);
    }
    //设置按钮文本
    public void setBtnRightText(String str){
        if (btn_right!=null){
            btn_right.setText(str);
        }
    }
    public void setBtnLeftText(String str){
        if (btn_right!=null){
            btn_right.setText(str);
        }
    }
    //设置标题背景
    public void setTvTitleBackground(int resId) {
        if (tv_title != null) {
            tv_title.setText(resId);
        }
    }

    //设置标题文本
    public void setTitleText(String str){
        if (tv_title!=null){
            tv_title.setText(str);
        }
    }

}
